<template>
  <div>
    <p><input type="text" v-model="t_list.t_name"  placeholder="请输入路线名"></p>
    <p><textarea  cols="30" rows="10" v-model="t_list.described"  placeholder="描述"></textarea></p>
    <p><input type="text" v-model="t_list.price"  placeholder="价格"></p>
    <p><button @click="add">添加</button></p>
  </div>
</template>

<script>
export default {
    data(){
        return{
            t_list:{
                t_name:'',
                described:'',
                price:''
            }
        }
    },
    methods:{
        add(){
            this.$axios.post('add/', this.t_list).then((res)=>{
                if(res.data.code == 200){
                    alert('添加成功')
                    this.$router.push('/show')
                }
            })
        }
    }
}
</script>

<style>

</style>